
class BannerListModel {
  List<BannerListItem>? list;
  int? pageNum;
  int? pageSize;
  int? total;
  int? totalPage;

  BannerListModel({this.list, this.pageNum, this.pageSize, this.total, this.totalPage});

  BannerListModel.fromJson(Map<String, dynamic> json) {
    if(json["list"] is List) {
      list = json["list"] == null ? null : (json["list"] as List).map((e) => BannerListItem.fromJson(e)).toList();
    }
    if(json["pageNum"] is num) {
      pageNum = (json["pageNum"] as num).toInt();
    }
    if(json["pageSize"] is num) {
      pageSize = (json["pageSize"] as num).toInt();
    }
    if(json["total"] is num) {
      total = (json["total"] as num).toInt();
    }
    if(json["totalPage"] is num) {
      totalPage = (json["totalPage"] as num).toInt();
    }
  }

  static List<BannerListModel> fromList(List<Map<String, dynamic>> list) {
    return list.map(BannerListModel.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    if(list != null) {
      _data["list"] = list?.map((e) => e.toJson()).toList();
    }
    _data["pageNum"] = pageNum;
    _data["pageSize"] = pageSize;
    _data["total"] = total;
    _data["totalPage"] = totalPage;
    return _data;
  }

  BannerListModel copyWith({
    List<BannerListItem>? list,
    int? pageNum,
    int? pageSize,
    int? total,
    int? totalPage,
  }) => BannerListModel(
    list: list ?? this.list,
    pageNum: pageNum ?? this.pageNum,
    pageSize: pageSize ?? this.pageSize,
    total: total ?? this.total,
    totalPage: totalPage ?? this.totalPage,
  );
}

class BannerListItem {
  String? bannerImageUrl;
  String? detailImage;
  int? sort;
  String? title;

  BannerListItem({this.bannerImageUrl, this.detailImage, this.sort, this.title});

  BannerListItem.fromJson(Map<String, dynamic> json) {
    if(json["bannerImageUrl"] is String) {
      bannerImageUrl = json["bannerImageUrl"];
    }
    if(json["detailImage"] is String) {
      detailImage = json["detailImage"];
    }
    if(json["sort"] is num) {
      sort = (json["sort"] as num).toInt();
    }
    if(json["title"] is String) {
      title = json["title"];
    }
  }

  static List<BannerListItem> fromList(List<Map<String, dynamic>> list) {
    return list.map(BannerListItem.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["bannerImageUrl"] = bannerImageUrl;
    _data["detailImage"] = detailImage;
    _data["sort"] = sort;
    _data["title"] = title;
    return _data;
  }

  BannerListItem copyWith({
    String? bannerImageUrl,
    String? detailImage,
    int? sort,
    String? title,
  }) => BannerListItem(
    bannerImageUrl: bannerImageUrl ?? this.bannerImageUrl,
    detailImage: detailImage ?? this.detailImage,
    sort: sort ?? this.sort,
    title: title ?? this.title,
  );
}